/**
 * 封装百度Echart
 */
function Echart() {
}

Echart.inherit(Control);

Echart.prototype.init = function() {
	Echart.base.init.call(this);
}

Echart.prototype.create = function() {
	var template = "<div></div>";
	this._html = $(template)[0];
}

Echart.prototype.initLoad = function() {
	if (typeof(echarts) == "undefined") {
		this.loadScriptFile("/public.common/webapi/common/echarts/echarts.min.js");
	}

	//TODO:初始化前调用事件
	this.triggerAttributeEvent("oninit");
	this._chart = echarts.init(this._html);
	var that = this;
	//TODO:绑定click事件
	this._chart.on('click',function (params) {
		that.triggerAttributeEvent("click",params.data);
	});
}

Echart.prototype.setOption = function(option){
	this._chart.setOption(option);
}

Echart.prototype.resize = function(){
    this._chart.resize();
}